<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../../lib/echarts/dist/echarts.js"></script>
</head>
<body>
<div id="main" style="width:100%;height:400px;"></div>
<script type="text/javascript">
    var myChart = echarts.init(document.getElementById('main'));
    option = {
        xAxis: {
            type: "time",  // x轴时间类型<br>        position: "top" // x轴位于上方
            position : "top"
        },
        yAxis: {
            type: "category",
            data: ["九月", "令狐冲", "乔峰", "唐家三少"].reverse()
        },
        series: [
            {
                type: 'bar',
                barWidth: '10',
                barGap: "-100%", // 计划和进度重叠
                stack: "计划",  // 占位条和着色条合并
                itemStyle: {
                    normal: {
                        opacity: 0 // 不绘制，仅作为占位条
                    },
                    emphasis: {
                        opacity: 0
                    }
                },
                data: [
                    [new Date(2017, 9, 1), "九月"],
                    [new Date(2017, 9, 1), "令狐冲"],
                    [new Date(2017, 9, 29), "乔峰"],
                    [new Date(2017, 9, 10), "唐家三少"]
                ]
            },
//            {
//                type: 'bar',
//                barWidth: '30',
//                stack: "计划",
//                itemStyle: {
//                    normal: {
//                        color: 'red'
//                    }
//                },
//                data: [
//                    [new Date(2016, 6, 30), "九月"],
//                    [new Date(2016, 3, 29), "阶段一"],
//                    [new Date(2016, 5, 10), "阶段二"],
//                    [new Date(2016, 6, 30), "阶段三"]
//                ]
//            },
            {
                type: 'bar',
                barWidth: '10',
                stack: "进度",
                itemStyle: {
                    normal: {
                        opacity: 0
                    },
                    emphasis: {
                        opacity: 0
                    }
                },
                data: [
                    [new Date(2017, 9, 01), "九月"],
                    [new Date(2017, 9, 10), "令狐冲"],
                    [new Date(2017, 9, 15), "乔峰"],
                    [new Date(2017, 9, 20), "唐家三少"]
                ]
            },
            {
                type: 'bar',
                barWidth: '10',
                stack: "进度",
                itemStyle: {
                    normal: {
                        color: 'green'
                    }
                },
                data: [
                    [new Date(2017, 9, 07), "九月"],
                    [new Date(2017, 9, 18), "令狐冲"],
                    [new Date(2017, 9, 25), "乔峰"],
                    [new Date(2017, 9, 30), "唐家三少"]
                ]
            }
        ]
    };
    myChart.setOption(option);
</script>
</body>
</html>